added search function. currently working on adding state search