Attempt at another method for period calulcations and unit test fixes