added endgame score calculation by counting enclosed territory, and fixed a bug with the initial point being double-counted in genGroup