reduse space added
reduse space write file added and change in sort