Added has_loop method