Finished homework 2.2