What if period is < 0 .. this will still test true.  What if this is 'true' or something non-int?
Don't always need to check types are correct, but good to fail early.  Test for >0 here would be better I think.  Check chrome for what happens with a period <= 0