Implementing regression forest