Sorted Feature

Fixed the sorting issue