Add hanoi function.