added code for hw2