Added search terms and cleaned up code for category search