new version for issue #7