added printf to check code