all functions are finished, debug