update selection sort, show before and after state