improved \prd and \sm magic