using the partition function
implemented the round trip for the inmemory mode
and tested on the cluster as well