Stupidly complicated lane allocation algorithm mkIII