roughly implemented #9, fixed #20, mostly implemented #21, and #22 should work, but wont