working on writing reference data to disk