implemented /flush, general cleanups