handling empty set of lists as well