Add flatMap to the State example