Simple cycle detection (with hard-coded values) added