Added function for writing wordlist to file