Added new functions: calcPD and uniquePD