first working version (streamlines)
make sure that reduce() is executed