Solved problem 5,6 and 7.