fix a bug about where to put sort() and how to name it.