Improves performance by pre-calculating memory offsets that were being performed in tight loops.