modified the algorithm of channel assignment