increased speed by optimizing thread count and chunk size