adding algorithm manager and performacne improvement