Added sorting in ascending and descending order