Got the function operator working. Now sorts correctly.