changed value initialization to -1 in Node constructor