homework 3 code finished