Adding test function for updateG