problem 3 first commit: finished the problem without testing
problem 3 2nd commit