#2 add debug logging