LPS-34936

There's a return on the second block of the big if section that is unnecessary, but I left it there as it might help in the future.