     objState = stateFromSgfObject sgfObject,
                                   moves: moveToShow,
                                   scoring: scoringMode
-    {boardState, lastPlayed, prisoners} = objState
+    {boardState, lastPlayed, prisoners, scores} = objState
     size = parseInt(sgfObject.gameTrees[0].nodes[0].SZ, 10) or 19
     nextColor = null
 

      when 'neither' then 'dame'
      else throw new Error "invalid boundary color: '#{boundary}'"

  {boardState: boardState, prisoners: prisoners}

getEmptyRegions = (state) ->
  regions = []

      prisoners.white += result.captures.white
  if scoring
    [x, y] = [null, null]
    {boardState, prisoners, scores} = scoreState {boardState, prisoners}
  else
    scores = null
  {boardState, lastPlayed: {x, y}, prisoners, scores}

scoreState = (stateObj) ->
  "given a board state, change its 'empty' points to 'blackscore',
  'whitescore' and 'dame' and return it with prisoner counts and total
  scores"
  {boardState, prisoners} = stateObj

  setRegionScores = (region, color) ->
