refactor -- adding debug.js