applied PR from Steve to close issue #96 and issue #97