added a remove_unwanted_chars function