Saved some memory by reducing the size of some arrays to only what's needed.