possible solution to issue #22

Awaiting feedback on this issue, until then here's some needed changes!