trying to implement minkey and maxkey totally