support for maxkey and minkey