Adding Seq.foldWhile