Updated the kernel to work with periods specified as firsperiod + steps.