Added function to calculate damage done.