A not so great solution for problem 3