Refactored loops over ants to for each loops.