keep stacks in vector<> and use them LIFO

reduced malloc count, reduced cache pressure