Corrected mistake with memory limit calculation