add dynamic user doc num algorithm