Major bug fixed, added better search algorithm.