implement find() function