Finally solved problem 111