There is a good article on CMP on Indigo with relevant code examples.