First implementation of Selection Sort