Added Check for Format of file and Debugged the sorter