Patch

I am going to push this into the OSS and then refactor it.