initial commit code got from subnot-test/trx_parser