added code from HW1