Created script file with sort function