added design matrix and glm estimation