sort arguments passed to program