Major speed enhancement

It was taking way too long to compile. This fixes that issue.