Excercise 3 using math