much cleaner, but only a little faster, for problem 60