Issue 20

Merge work on #20 into issue-12 branch