hate doing this, but I couldn't take mixed indenting anymore in cgm.c; start passing reading timestamp to c code