Added sorting based on dates