modified sort function to downcase the fields