script for writing all json