added 1/2 to the equation