Tested and debugged using jsonxx for outputting the vocab