the final version of flat-map/map operators