Rewritten code.

Implemented xoft suggestion.
Using MoveToPosition as tigerw suggested.