implemented ability to take in json data for category data matrix