Converted many of the for loops in the Figure class to foreach loops,
taking advantage of Java's array passing