moved dir, file, path for optimization. Added cython version