Added search function, more tests