update max and add my_sub