Update:
The results I got were a bit odd, and I though it was because of my distance function, but when I checked my distance function with the data in a different format it gave me always a distance of 0.
Last update:
I just realized I was using the wrong set of data, haha.
If it helps to explain, in case anyone has a similar problem, I was using sequences of different lengths when my custom function only worked with sequences of equal lengths.