def cleanup(dirty):
    """ remove invalid characters from phone number """
    allowed = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
    newstring = ""
    for char in dirty:
        if char in allowed:
            newstring += char
    return newstring