the implementation of the partition