Removed modulus operators for array indexing.
Modified arrays indexing to get rid of modulus.
Changed array indexing to use a bitmask.