optimized write speed up to ~8 MB/s (still pretty slow!)