box cox multi-dimensional sapling code from lisha chen