Hanoi towers implementation