changed the helper functions so that they won't tamper with the free_ptr , now they make copies and use those instead