some changes + cycle checking