Consistent use of foreach
Uses std.array instead of std.algorithm