add logic for import mode
fix small bug when writing output to file for hashtable algorithm