```
import urllib.request
import json
from collections import Counter

def count_coauthors(author_id):
    coauthors_dict = {}

    url_str = ('https://api.semanticscholar.org/graph/v1/author/47490276?fields=name,papers.authors')
    respons = urllib.request.urlopen(url_str)
    text = respons.read().decode()

    for line in respons:
        print(line.decode().rstip())

    data = json.loads(text)
    print(type(data))
    print(list(data.keys()))
    print(data["name"])
    print(data["authorId"])

    name = []
    for lines in data["papers"]:
        for authors in lines["authors"]:
            name.append(authors.get("name")) 
        print(name)

    count = dict()
    names = name
    for i in names:
        if i not in count:
            count[i] = 1
        else:
            count[i] += 1
    print(count) 

    c = Counter(count)
    top = c.most_common(10)
    print(top)

    return coauthors_dict

author_id = '47490276'
cc = count_coauthors(author_id)

top_coauthors = sorted(cc.items(), key=lambda item: item[1], reverse=True)
for co_author in top_coauthors[:10]:
    print(co_author)

```

This is how my code looks this far, there are no error. I need to get rid of the rest of the text when I run it, so it should look like this:

```
('Diego Calvanese', 47)
('D. Lanti', 28)
('Martín Rezk', 21)
('Elem Güzel Kalayci', 18)
('B. Cogrel', 17)
('E. Botoeva', 16)
('E. Kharlamov', 16)
('I. Horrocks', 12)
('S. Brandt', 11)
('V. Ryzhikov', 11)

```

I have tried using rstrip and split on my 'c' variable but it doesn't work. Im only allowed importing what I already have imported and must use the link which is included.

Tips on simplifying or bettering the code is also appreciated!

("Extend the program below so that it prints the names of the top-10 coauthors together with the numbers of the coauthored publications")