inefficient solution to problem 1