updated to support multiple nodes being passed in