Finished homework 3