Initial port of changes
Bring this to compile so that Moe can review changes