Import sys and add flush commands