Search algorithm

Add algorithm and test for search()