Write a Python program to create a dictionary of the elements in a list and their frequency count.
list = [3, 2, 3, 4, 5]
def frequency_dict(list):
    counts = {}
    for i in list:
        if i not in counts:
            counts[i] = 1
        else:
            counts[i] += 1
    return counts

print(frequency_dict(list))