naive solution to problem 15 complete