tests and debugging