use fmap in algos