Implemented flatMap and iterate