Complete Step-by-step Particle Swarm Optimization Algorithm from Scratch