added toString methods and debug messages