add master-node code