Adding func to partition slice