refactored select from dropdown list to take various inputs