solved problem 2 (2.66ms)