improved debug system