add std=c++0x in compile argument
move code out of codebook.tex
add sais (twt's code)