Code for CS176 HW2