Tower of Hanoi problem solving using recursion