mathlog hw5. 3 fixed