Wrote a node class and added a constructor