def makeIntervals(evts):
	"""From evts=[a,b,c], create a list of intervals: [(0,a), (b,c)]
	From evts=[a,b,c,d], create a list of intervals: [(0,a), (b,c), (d,1)].
	Assumes all values in evts are in (0,1)"""
	if evts == []: return [(0.0, 1.0)]
	evts.sort()
	left = 0.0
	intervals = []
	for e in evts:
		if left >= 0.0:
			intervals.append((left, e))
			left = -1.0
		else:
			left = e
	if left >= 0.0 and left < 1.0:
		intervals.append((left, 1.0))
	return intervals