The problem is your programming method. There are no steps, no progress. Other problem source is the using set and reset instructions. Avoid these if it is possibile. Make a state machine, otherwise you just will waste your time with countinous debugging every day.