Adding 31 problem solution