updated to have lab debug function