works for hw1-1 hw1-2