Add helper functions to find next fat and root index