added functions getPFromMultiple and puj