last foreach statement added (1 test still failing)