validate the nodes array in a separate routine

instead of keeping that logic in the constructor