use max-function to determine highest order number