fixed converting string to list
finished sorting script