Updating the position logic