change these to specific  pop_stack() calles or use pop_n_elems(X) .