move debugging functions to sep file