Fixes #10, mostly working