Add documentation for filter and flatMap