maxBy & minBy skeletons (needs debugging)