Fix hard-code values and implement node-function and nodes-function