pso algorithm skeleton