comments and rename calculateDamage function