Added mg_next()
Added pubsub example