Added clean function to remove unwanted characters from input