solved problem31