Initial work on time ranges
Consolidated Ray's changes