public void step()
  {
    boolean[][] newGrid = new boolean[height][width];

    // Iterate through all cells
    for (int y = 0; y < height; y++)
    {
      for (int x = 0; x < width; x++)
      {
        // Implement rules
        boolean cell = grid[y][x];
        int aliveNeighbours = getAliveNeighbours(x, y);

        if (cell)
        {
          if (aliveNeighbours < 2 || aliveNeighbours > 3)
            newGrid[y][x] = DEAD;
          else
            newGrid[y][x] = ALIVE;
        }
        else if (aliveNeighbours == 3)
          newGrid[y][x] = ALIVE;
      }
    }

    grid = newGrid;
  }