Corrected F and G (I think)