updated solutions
made the solution to problem 3 more efficient