public void rotateBlock()
	{
		boolean rotatable = true;
		int counter = 0, adjust = 0;
		int newPose, newWidth, newHeight;
		int[] newx = new int[4];
		int[] newy = new int[4];

		newPose = (currentBlock.brickPose + 1) % NumPoses;

		newWidth  = bricks[currentBlock.brickType][newPose].w;
		newHeight = bricks[currentBlock.brickType][newPose].h;

		if( currentBlock.xposition + currentBlock.height > COLS )
			if( currentBlock.height != 4 )
				adjust = -1 * ( currentBlock.height - 2 );
			else
				adjust = -1 * ( currentBlock.height - 1 );

		for( int i = 0; i < newWidth; i++)
			for( int j = 0; j < newHeight; j++)
			{
				if( bricks[currentBlock.brickType][newPose].grid[j].charAt(i) == 'X' )
				{
					newx[counter] = currentBlock.xposition+i+adjust;
					newy[counter] = currentBlock.yposition+j;
					if( colorGrid[newy[counter]][newx[counter]].isSet )
						rotatable = false;
					counter++;
				}
			}

		if( rotatable )
			for( int i = 0; i < 4; i++ )
			{
				currentBlock.brickPose = newPose;
				currentBlock.xvalues[i] = newx[i];
				currentBlock.yvalues[i] = newy[i];
				currentBlock.height=newHeight;
				currentBlock.width=newWidth;
			}
	}