Added some debugging write statements.