Added documentation and optimized util

I think when `size == 131072` first loop will not be executed as `0 < 131072 - 1*131072` is `false`.