Added a setPosition function

For #751