Updated Algo for Pub Sub