Rewrote while using letrec; no more infinite loop with break but it is effectively ignored; continue moved but still functional