Functions to solve the problems of the exercise list 1