Implementation of sort by & other features