write Node class