adding tests and debugging functions