Removed unused variables from g