cleanup, brute method for problem 8