g element function completed.