add some debug log entries to new functions, clean up some others