updates for #39 and #41