bugs in reading static arrays and modulus