polynomial design matrix function mostly finished