Revise the bounds of g function to reduce the size.