issue #31 almost complete