mathlog hw5. 2a fixed