DEBUG CORRECTED