resolves #18, fixes #28