add get extreme point function