corrected calculation of memory to be more conserative. Just in case.