created the head node as the private variable