Pr 436 branch copy

Re-creating the branch for PR #436 since I've deleted it and can no longer make the changes to it. I'll close #436 as this new PR will replace it.