added 2dof gadget code