fixing broken loop detection in compute_result