def prepare_data(dictionary, key_name, value_name, limit=10):
    """Prepare data for the bar plot. Convert key, value pairs to named objects"""
    data = []
    for key, value in dictionary.items():
        record = {key_name: key, value_name: value}
        data.append(record)
    return data[:limit]
