functions defined
partitioning implemented