add medianOfThree method