fixed issue where g was messing up the results