This is based on issue #22.