add example for using assigns *p in contract