Revert "Use a join, make it faster and more readable"

This reverts commit 5f25fe92d72e953a174707c554cd18e07541152f.
Does not return the correct number of marks for the most recent page scan