search functions fixed, some tests added