Added new sorting function
Updated main file