Changed prev, rate, and pulseRate to be signed ints