implemented selection sort. not optimized