without saving txt, using npy instead and some other optimization after profiling