some memory tweaks, untested