- Fixed non-contractibility check
- Added a working algorithm to find loops, but it's slow