search improved and number of functions cut down