Delete isWasUpperLimit. Add defines for upper and lower limits