non-recursive code...with bug finding comments