Copied from pull request https://github.com/kullmanp
wip
wip