added DEBUG switch