public int compareTo(Endpoint other) {
		
		double length = Math.abs(value);
		double otherLength = Math.abs(other.value);
		
		double distance = length - otherLength;
		
		if (distance == 0.0d)
		{
			if (type.ordinal() < other.type.ordinal())
			{
				return -1;
			}
			else if (type.ordinal() == other.type.ordinal())
			{
				return 0;
			}
			else
			{
				return 1;
			}
		}
		else if (distance > 0.0d) return 1;
		else return -1;
		
	}