reopen simon's PR #440 that I reverted

This reverts commit 01e44919990a18d034aae73c6c392b7c7c528381.