update CGM code

Updated 7/29/14