another ugly attempt at fragmented memory
Revert to working and correct memory allocation

This reverts commit 7b34849331f8b8561e03e998f08364585f964d76.
Revert to working and correct memory allocation

This reverts commit e04f310dfe98e4ddd186906ade0537433c9619c1.