implemented global and local predict logic to alpha.cc, still need refactoring