Finished homework 8