debuging the whole process