Made a change to memPart

memPart
-changed it so that it can find the indexes for the partitions properly