generalized stack, added tokenizer stuff