Improved correctness.
Faster but still incorrect.