replaced drop_every code with one line code using each_slice and reduce to get the same result