Adding xzxz's changes

Trying to get this to build by merging to master.