In a cable modem network, a cable modem (CM) talks to a cable modem termination system (CMTS) over a traditional cable-television network. The cable-industry-backed standard that specifies how a CM and CMTS talk to each other is called DOCSIS. In DOCSIS the CMTS schedules the upstream (CM-to-CMTS) channels, each of which is time-division multiplexed into a sequence of minislots. To schedule an upstream channel, the CMTS logically divides the channel into a contiguous sequence of intervals, each interval comprising a contiguous sequence of minislots. The CMTS assigns to each interval an interval type, which specifies how the CMs may use that interval. Initial maintenance intervals (IMIs) are used by CMs when they first come online. In some CMTS deployments, certain sets of upstream channels must be IMI aligned. A set of aligned channels has the property that for each IMI X mapped in any of those channels, all other channels in the set have an IMI that starts and ends at precisely the same time as X. This article describes a novel algorithm for aligning the IMIs in a set of DOCSIS upstream channels. This algorithm, which has been implemented and deployed in a real CMTS, is both efficient and flexible. In particular, it enables any set of channels to be aligned, even ones with different minislots sizes.