added serially and concurrently flatMap with tests