improving cutTree