Add flatMap. Some compilation issues, need internet access.