only tested with symmetric data and thus didn't find that the pdf's was unsorted, silly me, fixed now :)