Remove temporary `selections` variable

All changes to the `selections` property were cached
in a local `selections` variable to be copied over
after the each loop ends.

markSelected can be called inside the loop and
uses the `selections` property so changes to that
property need to be made in the same iteration
as it is called.