Improvement: changed SQL query to get the values in alphabetical order