starting on problem 3 -- this soln takes way long
faster and correct!