debug and beginning of the code