Slight modification to prep insertData function for rewrite