endOfHour function, closes #7