Updated flushing script