making changes to the sort_general by adding the code for time calculation