My code works fine to calculate various perks for towns. But I want to dynamically calculate other fields values as well.