Add codes 11/17

Add code for init, alloc_pdata, and free_pdata