Added p and cancel variable.