added sorting
added sorting