Added flatmap.