Add cleaner solution for problem 1-8.