adding flush command

and maybe some other stuff