Revised Gvalue function and add red lines to plots.