Removed all heap-based memory allocations since they can be done on the stack now that they are constant sized