Gh 1171

this is ready for merge.