Selection sort implemented.