Sort: gmem selection sort implemented, not working