Created a method for publishing