cleaned up Transaction.calculate_score