updated position logic