Finished homework 6