The header row is now determined dynamically