add test for each()