implementing _flatMap using compose