Add setKarelCode and debugging if conditional