Fixed Memory Variable Use

The memory usage was hard-coded, but now uses the variables we set at
the beginning of the file.