You seem to use periodInMinutes and alarmInfo.periodInMinutes  interchangeably from hereon out.  Not sure if there is a reason?