Iterative java solution to the 3-peg N-disk towers of hanoi problem