adjusted to new version of due_can, plus clean-up