adding Ahrsz algorihtm plus cycle removal plus tests