Structures and algorithms for Go