Init the insertData method, almost completed but not tested.