Finish exercise 5.1 & 5.2