public boolean update() {
		boolean rv = false;
		boolean sliding=true;
		updateneeded = false;
		if (!velocity.isZero()) { 
			justpotted = false;
			double dt = (System.currentTimeMillis()-lt)/1000;
			if (!hascollided)
				{
				MyVector dirofshot = pointofboard.normalize();
				velocity = dirofshot.dotProduct(velocity.dotProduct(dirofshot));
				}
			MyVector orthoVelocity = new MyVector(-velocity.y/velocity.magnitude(),velocity.x/velocity.magnitude());
			double walongv = w.dotProduct(orthoVelocity);
			if (sliding == true && isSliding(walongv))
				coeff = us;
			else
			{
				coeff = ur;
				sliding = false;
			}
			MyVector u = velocity;
			if (sliding)
			{
			int dirofForce = 0;
			if (Board.R*walongv-velocity.magnitude() < 0)
				dirofForce = -1;
			else
				dirofForce = 1;
			velocity = velocity.normalize().dotProduct(velocity.magnitude()+dirofForce*coeff*g*dt);
			MyVector wother = w.subtract(orthoVelocity.dotProduct(walongv));
			w = wother.add(orthoVelocity.dotProduct(walongv -dirofForce* 2*coeff*g*dt/Board.R));
			}
			else
			{
				velocity = velocity.normalize().dotProduct(velocity.magnitude()-coeff*g*dt);
				double newwalongv = velocity.magnitude()/Board.R; // making sure that R*walongv and velocity are same after it starts rolling. 
				MyVector wother = w.subtract(orthoVelocity.dotProduct(walongv));
				w = wother.add(orthoVelocity.dotProduct(newwalongv));
			}
			if (w.z >= 0)
			w.z -= 3*dt;
			u = u.add(velocity);
			u = u.dotProduct(dt * 0.5);
			 if (!collide(position.add(u)))
				
			position = position.add(u);
//			System.out.println(position);
			rv = true;
		}
		else
			w = new MyVector(0,0,0);
		lt = System.currentTimeMillis();
		
		rv = rv||justpotted;
		justpotted = false;
		return (updateneeded = rv);
	}