edited searching, added functionality