code from advance networks