def sort_work(params, priority):
    """
    Returns a dictionary as params but ordered by score
    Input:
       params = dictionary of the form  {input_name : value}
       priority = the list of input_name ordered by score calculated by score_function
    Output:
       sorted_dict = the same dictionary as params but ordered by score
    """
    sorted_dict = {}
    i = 0
    for index in priority:
        sorted_dict.update({i: params[index]})
        i = i + 1

    return sorted_dict