solved problem #31