Updated step function.