Fixes #13. Pretty happy with this for the time being