Starting work for dof, but not finished
Fix DOF issue