init code nearly complete