Changed insert_hashes to fit the new data format