added setPosition function