first pass at adding debug logging