added pd function