Refactored throughout to use pos() and unpos() rather than explict arithmetic on...