based on discussion in pr #24
based on discussion in pr #24