Made the code compilable. Also, the tokens output maches exactly with the reference implementation for all cfgs