Added factor and hanoi