Why is the entire algorithm implemented in uint8?  Doesn't that lose a lot of precision?