Figured out why connected(3,9) failed: array was made too short.  Fixed.