private boolean calculateVelocities() {
		boolean end1 = true, end2 = true;
		for (Point p : frontier.innerBorder) {
			velocities[p.x][p.y] = calculateVelocity(p);
			if (end1 && velocities[p.x][p.y] < 0) {
				end1 = false;
			}
		}
		for (Point p : frontier.outerBorder) {
			velocities[p.x][p.y] = calculateVelocity(p);
			if (end2 && velocities[p.x][p.y] > 0) {
				end2 = false;
			}
		}
		// System.out.println(end1 + " " + end2);
		return end1 && end2;
	}