Changes docAddresses to return unsigned int
Adds other CPU reference implementation for comparison