made mP (make P) a function