added option to consider input data a list