sets the right pointer of the new node's predecessor to point to the new node

setright(predecessor,p);