Ugly g_p update rule