checking for inputs and outputs arrays before iterating