Code Changed for a Sorting to Last