Finished homework 2