logging added

Added some logging statements to try and track down some bugs.