Debug mode added and documented