how can i systematically debug that script?