max2 using recursive to make codes simpler