Implemented basic (insufficiently parallelized) flushing.