adding null checkers to greaterRevenue