fixes #30
part of #18, closes #17