Why don't you compare your code to the one from the [wiki]Moving widgets[/wiki] article? Differences are kind of obvious.