assignment-1: finished problem 3