Sort function added
Filtering implemented