added equals and hashcode to Node