private void updateKinematics(Moving[] movings, double timestep) {
		Vector[] positions = new Vector[movings.length];
		Vector[][] velocities = new Vector[movings.length][4];
		Vector[][] accelerations = new Vector[movings.length][4];

		// set starting conditions and k1: y0 is position and velocity and k1 is
		// velocity and acceleration
		for (int i = 0; i < movings.length; i++) {
			positions[i] = movings[i].getPosition();
			velocities[i][0] = movings[i].getVelocity();
			accelerations[i][0] = getNetForce(movings[i]).divide(
					movings[i].getMass());
		}

		// get k2
		for (int i = 0; i < movings.length; i++) {
			Vector velocity = velocities[i][0];
			Vector acceleration = accelerations[i][0];

			movings[i].setPosition(positions[i].add(velocity
					.multiply(timestep * 0.5D)));
			movings[i].setVelocity(velocities[i][0].add(acceleration
					.multiply(timestep * 0.5D)));
		}
		for (int i = 0; i < movings.length; i++) {
			velocities[i][1] = movings[i].getVelocity();
			accelerations[i][1] = getNetForce(movings[i]).divide(
					movings[i].getMass());
		}

		// get k3
		for (int i = 0; i < movings.length; i++) {
			Vector velocity = velocities[i][1];
			Vector acceleration = accelerations[i][1];

			movings[i].setPosition(positions[i].add(velocity
					.multiply(timestep * 0.5D)));
			movings[i].setVelocity(velocities[i][0].add(acceleration
					.multiply(timestep * 0.5D)));
		}
		for (int i = 0; i < movings.length; i++) {
			velocities[i][2] = movings[i].getVelocity();
			accelerations[i][2] = getNetForce(movings[i]).divide(
					movings[i].getMass());
		}

		// get k4
		for (int i = 0; i < movings.length; i++) {
			Vector velocity = velocities[i][2];
			Vector acceleration = accelerations[i][2];

			movings[i]
					.setPosition(positions[i].add(velocity.multiply(timestep)));
			movings[i].setVelocity(velocities[i][0].add(acceleration
					.multiply(timestep)));
		}
		for (int i = 0; i < movings.length; i++) {
			velocities[i][3] = movings[i].getVelocity();
			accelerations[i][3] = getNetForce(movings[i]).divide(
					movings[i].getMass());
		}

		// finalize
		for (int i = 0; i < movings.length; i++) {
			Vector position = positions[i].add(velocities[i][0]
					.add(velocities[i][1].add(velocities[i][2]).multiply(2D))
					.add(velocities[i][3]).multiply(timestep / 6D));
			Vector velocity = velocities[i][0].add(accelerations[i][0]
					.add(accelerations[i][1].add(accelerations[i][2]).multiply(
							2D)).add(accelerations[i][3])
					.multiply(timestep / 6D));
			movings[i].setPosition(position);
			movings[i].setVelocity(velocity);
		}
	}