fixes #36, in progress with #32