changed States.states from dict() to list() for sorting.