replaced Seq.empty with Nil