adds implementation for selection sort