wont a map and flatten here be better?