unit count and building count calculation added