add regression tree model structure. some general cleaning up too.