Replaced for with an each - looks neater and less Java-ey