Global grid and cellCount; working algorithm; comments