improved search functions