Fixes issue #134 -- could use some more abstraction

Fixes issue #134 -- could use some more refactoring but that's up to you guys :)