trying to integrate @wking's stuff

Obviously failing.