Slightly more accurate, slightly faster, positions code (with tests).
Removed excess (commented) code.