Added swap header, midpoint variable and start of median three if statement to find and move pivot