added check of tabulated cdf to make sure it is monotonically increasing
typo fix
made cdf tabulation use linear interpolation to avoid non-monotonicity