add in concepts of Code
Merge in changes from Qiyuan