Tower of Hanoi using stack implementation