finished some optimizations that sped up search 4-5x