Another way to solve the problem