Added example and debugging code