Improving memory usage.
Should only need ~20 MB now