Gh 931

This is tested on the demo and ready to merge.