Removing autopublish,and writing the necessary publish and subscribe functions.