added pcor function