debug + tests