Edited to handle cycle split