ported from previous ver
.