trails customizable, DEBUG switch added