Added getPos function