merged of Brandons Branch

I think I messed up a fix things, may need a fix or two.