wrote script to convert json to a matrix