progress on #19 and #22