Add some debug stuff + a few helper methods the pieces need