Changed normaliseToPeriod to be recursive instead of iterative