added deugging code