refactored next match code into a Session.NextMatch