this might not work if data is already an iterable