combined pull pull request #20 and #23