Made a bunch of changes to the stack so it works more like a real stack.