Man receives 40-year term for murder