finish first version of PSO