Updated sampleG and exponentiated g_upper