added stack to lexer and reworking ledger lex funcs