iterations over c and g values added