public void insertionSort(int[] myList)
    {
        for(int i = 1; i < myList.length; i++)
        {
            /* check if stopButton has been selected */
            if(stopFlag == true)
            {
                return;
            }
            
            int k = i;
            
            while(k > 0)
            {
                if(myList[k] < myList[k - 1])
                {
                    int temp = myList[k];
                    myList[k] = myList[k - 1];
                    myList[k - 1] = temp;
                    k--;
                    
                    try
                    {
                        sortThread.sleep(getMsSleepDuration());
                    }
                    catch(InterruptedException e)
                    {
                        System.out.println("Error: sleep interrupted" + e);
                    }
                    
                    repaint();
                }
                
                else
                {
                    k = 0;
                }
                
            }//end while loop

        }//end for loop
        
    }//end insertionSort()