merged alternative to issue #8