input is array of objects