Working on issue #22
Fixes #21.