updated price difference function