cleaning things up to use debug instead of console.log
variable cleanup
cleaning up old comments