The whole point of currentPos was to check if we are past even when there is no doc. I don't understand why I put the test inside the if (doc). I need to rethink this.