Inserted Code for Max Cycle Length