modified costs(Wasn't giving correct output), Sort should be working fully