sign errors in g, f still not right