add rest of HW1 functions