implemented a general search function; yet to test