algorithm simplified.
access restriction revised.