Revert "Removed more subtractions and a multiplies from calculating a memory location by using a pre-calculated lookup table."

This reverts commit c1c258ed9b0e48333f2f16988399efd2652a7c0c.
Revert "Removed a subtract and a multiply from calculating the memory location by using a pre-calculated lookup table."

This reverts commit 10ed690035e9619d2c4fbe799fa3087b71a9abf3.