additional bounds checks
completed P14
completed P15
:
completed P16