implemented strict bounds-checking to prevent buffer overflow! (does nothing to prevent hot tub overflow)