updating code from homework 2