Added sorting functionality and also added download button