merge new TJ code with Map class