Arrays: implement max in terms of min; get rid of sort()