refactored combat function