added boolean delayState

I added the boolean value delayState and initialized to false. The
getDelay function I modified to return this value, and then set it to
false under the section to reset delay.