create node class and matrix class