Added the get_connected_residues function