Final Sort implementation