Added search and wrote the tests