Changed calculation of background means