placed search functions in lib