Functions added and PSO in progress