Added item param to foreach
Moved preparation to bottom with foreach(BA)