the programs from HW1 and HW2