minor optimization changes.

still stuck on why random forest is so bad.