Added functional hanoi