added comments to a star algorithm and helpers, and properly implemented g_score