add flatMap capability