Finished homework 5 except for optional