rewrote #each using #until