Homework 2.2 done and tested