Store all the nodes in a stack

Speeds up the program a ton.