Fixes #29

My go at fixing issue #29