adapted logic