Added search to main code