Finished homework 5.1