changed the script so that one can easliy change the memory_limit