Added median polish algorithm