working code for CMS collaboration