finish math functions for question 2