Sigma gradient wrt g working!