This seems incredibly similar to the above function, why was an entirely separate one added instead of merging them?