work on #31 and #17
work on #31