working on #10
fixes #13; fixes #14