Solving the Towers of Hanoi Problem