partial rewrite of algorithm section and cc example. Not yet finished.