moved damage calculation out