restructuring testing and fixing calendarRange