corrected input to handle lists instead of single files