commit code for problem 6