New version for issue #2.