Least Squares Smoothing of Univariate Data to achieve Piecewise Monotonicity