added first half of hw2