function retSpaces = adjustPitsAndMonsters(row, col, spaces, explored)
if explored(row,col) ~= 2
if 0 < row+1 && row+1 < 5 && 0 < col && col < 5
      if spaces(row+1, col) ~= 0
           spaces(row+1, col) = spaces(row+1,col) + 20;
      end
end

if 0 < row-1 && row-1 < 5 && 0 < col && col < 5
      if spaces(row-1, col) ~= 0 
           spaces(row-1, col) = spaces(row-1,col) + 20;
      end
end

if 0 < row && row < 5 && 0 < col+1 && col+1 < 5
      if spaces(row, col+1) ~= 0
           spaces(row, col+1) = spaces(row,col+1) + 20;
      end
end

if 0 < row && row < 5 && 0 < col-1 && col-1 < 5
      if spaces(row, col-1) ~= 0 
           spaces(row, col-1) = spaces(row,col-1) + 20;
      end
end

end
retSpaces = spaces;

end