fetch tabs algorithm