modify example for allocate/deallocate