it was an interesting problem to solve.