finished random forest algorithm