fixed #2 #1, added debug mode