Add allocate and deallocate free functions