The first half of the Pronlem 1 tasks
some fixes