smooth movement when draging a GUI texture

What the code below basicly does is that when you click and hold anywhere on the screen and move the mouse in X, a GUI texture(guitex) is moving with the mouse. The script works but its a little bit laggish (not smooth). So by looking at the code, does anyone have any idea on how to make it more smooth when draging?

private var oldMousePos : float;
private var newMousePos : float;

function Update () {

var go = GameObject.Find("guitex");

if (Input.GetMouseButtonDown(0)){// Set when clicked, where our mouse is
	oldMousePos = (Input.mousePosition.x/Screen.width)-(newMousePos - oldMousePos);
}
if (Input.GetMouseButton(0)){// This keeps running while mouse is held down
	newMousePos = Input.mousePosition.x/Screen.width;
	go.transform.position.x = newMousePos - oldMousePos;
}
}

Also posted this question here: http://forum.unity3d.com/threads/95941-smooth-movement-when-draging-GUI-texture-script?p=624843#post624843

Instead of teleporting to the newMousePos (directly setting the transform) linearly (or spherically, or whatnot, if you want nicer effects) interpolate to it.

go.transform.position.x += (newMouse - ouldMousePos) * 0.5 //change the factor between [0.0,1.0] for interpolation speed;

The only problem is that now when you go mouseUp the position will not be the mousePosition exactly, because it’s still ‘traveling’ there. To fix that I would do something like:

if( Input.GetMouseButtonUp( 0 ) )
{
    var rate : float = 1.0 / (time you want it to take to travel to the mousePosition);
    var index : float = 0.0;
    var startPoint : float = go.transform.position.x;
    while( index < 1.0 )
    {
        index += rate*Time.deltaTime;
        go.transform.position.x = startPoint + (newMouse - ouldMousePos) * index;
        yield;
    }
    go.transform.position.x = startPoint + (newMouse - ouldMousePos);
}