flatMap is now correct