The sorting was not working

The sort function does not work properly with the old approach, you have to return -1, 1 or 0. This commit fixes that.