[optimize] fase-2 pair algortime by OOP