getPosition function added