lots of changes, working 32-bit, optimal allocation now occurs every M iterations