Brought in changes from ccraig7 branch