working multithread for small sizes