revised version of PR #154

updated version of PR #154