Implement czchen-10165
Use unsigned int to avoid overflow
Merge branch 'czchen/10165'

* czchen/10165:
  Use unsigned int to avoid overflow
  Implement czchen-10165