The "nicest" solution is strongly dependant of the number of individuals you expect. If you deal with a couple of hundred thousand individuals you should be careful with memory and/or runtime.
So: how many data do you expect?
pelagic
-------------------------------------
I can resist anything but temptation.