- starting g function