revert max min functions