add tests and debug functions