fixed foreachloop to use Rectangle2D.Double