programming class HW2 final version