change script to allow specification of memory allocation