Added sorting functionality to index.html