debugging routine updated