public boolean equals(Object tape) {
		if (tape == this)
			return true;
		Tape t;
		try {
			t = (Tape) tape;
		} catch (ClassCastException e) {
			return false;
		}
		// These variables are necessary for going into the tape so we
		// can consider everything other than the "blank" prefix.
		int[] first = new int[2], second = new int[2];
		// Do not consider the blank prefixes.
		this.nonTrivial(first);
		t.nonTrivial(second);
		// If they're not the same length, who cares?
		if (first[1] - first[0] != second[1] - second[0])
			return false;
		// If they're at different positions, who cares?
		if (tapeHead - first[0] != t.tapeHead - second[0])
			return false;
		// If all else fails, compare the characters.
		for (; first[0] < first[1]; first[0]++, second[0]++)
			if (buffer.charAt(first[0]) != t.buffer.charAt(second[0]))
				return false;
		// We've made it!
		return true;
	}