Added sorting and filtering functionality to the main activity