Working "p" function.