commit code for problem 4 & 5