median option was added to the calculation of the expected signal.