made debug handlers with printing switch
added more debug statements
added debug section to debug