A Self-Organising Solution to the Collective Sort Problem in Distributed Tuple Spaces