Iterative solution to towers of hanoi d