Applying Chao's inital commits to latest branch of charm,