Fixed a typo and changed 'id' to 'g_id' to avoid conflicts with python's id function