Added publish method, but tests are still needed.