prototype of pso with both mapping and ordering