solved problem 491