old version: code minor adjustment.