made ADT more efficient by not maintaining in_stack in reverse order