Fixes #5

Rebased and changed, this commit should close issue 5 now