new function

auto delete the struct
delete struct