.flatMap rather than map.flatten.