for.Each update and global vars removed in favor of containing them to their functions