Massive performance increases.

Logic is still messed up. Ug.