Add flatMap method