public CharacterClass intersect(CharacterClass cc) {
		CharacterClass i = new CharacterClass();
		
		int p2 = 0;
		
		for (int p1 = 0; p1 < size / 2; ++p1) {
			int f1 = ranges[p1 * 2];
			int t1 = ranges[p1 * 2 + 1];
			
			while (true) {
				if (p2 >= cc.size / 2) {
					return i; // done
				}
				
				int f2 = cc.ranges[p2 * 2];
				int t2 = cc.ranges[p2 * 2 + 1];
				
				if (f2 > t1) {
					// this: -->
					// cc:        <--
					break; // compare next range in this to current cc range
				}
				
				if (f1 > t2) {
					// this:      <--
					// cc:   -->
					++p2;
					continue; // compare next cc range to current range of this
				}
				
				if (f1 > f2) {
					if (t1 > t2) {
						// this:   <--->
						// cc:   <--->
						i.add(f1, t2);
						++p2; // compare next range in cc to current range of this
					} else {
						// this:   <-->
						// cc:   <------>
						// right sides can be equal
						i.add(f1, t1);
						break; // compare next range in this to current cc range
					}
				} else {
					if (t1 > t2) {
						// this: <------>
						// cc:     <-->
						// left sides can be equal
						i.add(f2, t2);
						++p2; // compare next range in cc to current range of this
					} else {
						// this: <---> 
						// cc:     <--->
						// right and left sides can be equal
						i.add(f2, t1);
						break; // compare next range in this to current cc range
					}
				}
			}
		}
		
		return i;
	}