perfected GenerateRpd