you can also use segments.isEmpty()