WIP Add debug logging