Solution for excersice 1-16.