public void beginStep(List<Body> bodies, double dt) {
        for (Body b : bodies) {
			double k = b.getKineticEnergy();
			Vector2d v = b.getVelocity();
			Vector2d p = b.getPosition();
			double x = p.getX(), y = p.getY(), r = b.getRadius();
			if (x + r > wall)
				v = scale(v, v(v.getX() > 0 ? -damping : 1, 1));
			else if (x - r < -wall)
				v = scale(v, v(v.getX() < 0 ? -damping : 1, 1));
			if (y + r > wall)
				v = scale(v, v(1, v.getY() < 0 ? 1 : -damping));
			else if (y - r < -wall)
				v = scale(v, v(1, v.getY() > 0 ? 1 : -damping));
			b.setVelocity(v);
			internalEnergy += k-b.getKineticEnergy();
        }
	}