added condition for DEBUG and TEST
implemented new functions for process data