assignment-1: finished problem 2