Switched some things to foreach