closes #19 and #22