Renamed Segments() to SplitN(), added parameters, and created a new Segments() using SplitN() while maintaining the original functionality.