Resolves #28
a bunch of work on #10
resolves #62