conversion to json over, needs polishing now