Adding process matrix funciton