in the half of coding problem 31