Pruned code
Added search