ENH: simpler implementation