Added prunegraft function