good catch! super minor nit: can you change it to .iterator instead of .toList? no need to duplicate the whole list into memory