First pass for #45
Fixes #45