Implemented Selection sort