changed model matrix to use dplyr to fix bug