Added some debug code to solve issue 10.