First working version of both pub and sub