additional changes: revert back to using <0 as unlimited memory rather than <=0