def slowcomplete(mylist, prefix, k):
    """
    Given a prefix, suggest the top k words with the highest weight  
    Params:  
            prefix: the prefix to search in the list
            mylist: a list with stored words and corresponding weights
            k: the number of top recommendations ordered by weight  
    Return: 
            reclist: list of top k recommendations matching the prefix
    """
    assert isinstance(mylist, list), "The search space should be a list."
    assert isinstance(prefix, str), "The prefix should be a string"
    assert isinstance(k, int), "The number of suggestions should be a positive integer"
    assert k > 0, "The number of suggestions should be a positive integer"

    reclist = []
    for i in range(len(mylist)):
        # note: mylist contains [(weight1, word1), (weight2, word2), ...]
        if prefix != mylist[i][1] and mylist[i][1].startswith(prefix):
            reclist.append(mylist[i])
    reclist = sorted(reclist, key=lambda x: x[0], reverse=True)
    if len(reclist) == 0:
        return 'No words match with the given prefix.'
    return reclist[0:k]
    # return [x[1] for x in reclist[0:k]]