Implement debug lines; this took forever because of a very stupid problem