Updates from @jpasqua and  Haitao.
Rebuilt from scratch