The g function