Homework 1 code