Completed HW8, untested code as of now.