private int clearRows()
	{
		boolean check = true; // Used to determine if the row is full
		boolean deletionMode = false; 
		int rowsCleared = 0;
		// Navigate through the grid, starting with columns
		for (int j= 0; j < GRID_HEIGHT; j++)
		{
			// Navigate through the current row
			for (int i = 0; i < GRID_WIDTH; i++)
			{
				// If we are in deletion mode
				if (deletionMode)
				{
					// Deactivate every tile in the row
					if (grid[i][j] != null)
					{
						grid[i][j].setActive(false);
						grid[i][j].setColor(Color.white);
					}
					// If this is the last tile, go back to normal mode
					if (i + 1 == GRID_WIDTH)
					{
						deletionMode = false;
						check = false;
						reAllign2(j);
					}
				}
				// If we are in normal mode, check the row for any empty spot
				else if (!deletionMode && (grid[i][j] == null || !grid[i][j].getActive()))
				{
					// If we found an empty spot, start checking the next row
					check = false;
					break;
				}
			}
			// If we never found an empty spot in the row
			if (check)
			{
				// Re-test the row, but this time use deletion mode
				j--;
				rowsCleared++;
				deletionMode = true;
			}
			check = true;
		}
		return rowsCleared;
		
	}