Major speed improvements, still needs more work.