done with excercise n.2 and finished with functions concerning 3a and 3b