Added hooks and [extern] function