Finished homework 4