Cleaned/ commented code and sped up generation

I sped the engine generation by doing all the draws for each type at
once.