Further work on #28.
Resolving merge conflict.