added a new function to extract valid/invalid addresses from the script_eval() result
tidied up