working prototype for pso