def calculateStats(numbers):
    """
    This function calculates the average and sorts the maximum and minimum values
    :param numbers: Function parameters as a list
    :return: Dictionary with respective values[avg, max, min]
    """
    try:
        avg = sum(numbers) / len(numbers)
        numbers.sort()
        max = numbers[-1]
        min = numbers[0]
    except ZeroDivisionError:
        avg = 0
        max = 0
        min = 0
    computedStats = {'avg': avg, 'max': max, 'min': min}
    return computedStats