Write a Python program to return a list that contains all the elements of a given list except the given element x.
[3, 5, 9, 8], x = 5
def removeElement(list, x):
    new_list = []
    for item in list:
        if item != x:
            new_list.append(item)
    return new_list