Added Debug mode

Need to squash the bug