actually lets move this function into to preprocess node, as no one else is likely to call it.