Fixed step 1 - product mapping, remove nodes with no links, update write to file