closes #38, closes #22