new file for functions + fix debug things