sequence in terms of traverse (fp in scala)