use each_slice, available in ruby19