working counterToJSON converter