Add publish function (WIP)