Implementing exercises 5,6,8,9 and 10.