excercises 1-7 implemented