fixed issue #1:  ("initCount - what does it do?")
Fixed issue #2: "peak-to-peak amplitude for relay is 2*oStep"
Fixed Issue #4

nLookBack could potentially be 100, in which case 'i' starts at 99,
the end of the array, only for lastInputs[100] to eventually be
updated. I would think the array should be declared of size 101 to
fix this, yes?
merged recent changes from br3ttb