Ported initial association code