Added some more code with a focus on debugging.