added prune funct