Moved everything on stack

Better  CPU cache behavior.