added reference link
handle empty lists better