used non standard for each loop, fix test