connections pseudocode