excercise 1-26 implemented