I think it should be `(sorted.length - 1) * fraction` since the index of the highest element is `sorted.length - 1`