updating pattern grid