sorting the command list