Implementation without threading