added error checking to prevent doing invalid connections
added basic validation logic that ensures that nodes are not evealuated if they don't have the valid input