resolved issues #36 and #40