added a lot more logging to this example