Added selectionLength() helper method