Revert "Revert "merging in changes from upstream""

This reverts commit 38dac0433a6de4e4a5340495a0ee21b7b7b9e1aa.
i think this merge is all good now